
using System;
using System.Configuration;
using OF.Security.Properties;

namespace OF.Security.Utils
{
	public static class ConfigurationExceptionHelper
	{
		public static void CheckSectionNotNull(ConfigurationSection section, string sectionName)
		{
			ExceptionHelper.FalseThrow<ConfigurationException>(section != null, Resources.CanNotFoundConfigSection, new object[]
			{
				sectionName
			});
		}

		public static void CheckSectionSource(ConfigurationSection section, string sectionName)
		{
			ConfigurationExceptionHelper.CheckSectionNotNull(section, sectionName);
			ExceptionHelper.FalseThrow<ConfigurationException>(section.ElementInformation.Source != null, Resources.CanNotFoundConfigSectionElement, new object[]
			{
				sectionName
			});
		}
	}
}
